#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: build_message_queue.py 
@version:
@time: 2022/09/05 
"""
from TapDevops.build_jenkins.build_base import BuildBase2
from TapDevops.build_jenkins.v2 import *


class BuildMessageQueue(
    BuildBase2,
    V2MessageQueueTaskSetting
):
    def task_message_queue(self, _type):
        title = ''
        path = ''
        if 'source' in _type:
            if 'copy' in _type:
                if 'kafka' in _type:
                    title = self.title_source_kafka_copy
                    path = self.path_source_kafka_copy
                elif 'activemq' in _type:
                    title = self.title_source_activemq_copy
                    path = self.path_source_activemq_copy
                elif 'rabbitmq' in _type:
                    title = self.title_source_rabbitmq_copy
                    path = self.path_source_rabbitmq_copy
                elif 'rocketmq' in _type:
                    title = self.title_source_rocketmq_copy
                    path = self.path_source_rocketmq_copy
            elif 'dev' in _type:
                if 'kafka' in _type:
                    title = self.title_source_kafka_dev
                    path = self.path_source_kafka_dev
                elif 'activemq' in _type:
                    title = self.title_source_activemq_dev
                    path = self.path_source_activemq_dev
                elif 'rabbitmq' in _type:
                    title = self.title_source_rabbitmq_dev
                    path = self.path_source_rabbitmq_dev
                elif 'rocketmq' in _type:
                    title = self.title_source_rocketmq_dev
                    path = self.path_source_rocketmq_dev
        elif 'target' in _type:
            if 'copy' in _type:
                if 'kafka' in _type:
                    title = self.title_target_kafka_copy
                    path = self.path_target_kafka_copy
                elif 'activemq' in _type:
                    title = self.title_target_activemq_copy
                    path = self.path_target_activemq_copy
                elif 'rabbitmq' in _type:
                    title = self.title_target_rabbitmq_copy
                    path = self.path_target_rabbitmq_copy
                elif 'rocketmq' in _type:
                    title = self.title_target_rocketmq_copy
                    path = self.path_target_rocketmq_copy
            elif 'dev' in _type:
                if 'kafka' in _type:
                    title = self.title_target_kafka_dev
                    path = self.path_target_kafka_dev
                elif 'activemq' in _type:
                    title = self.title_target_activemq_dev
                    path = self.path_target_activemq_dev
                elif 'rabbitmq' in _type:
                    title = self.title_target_rabbitmq_dev
                    path = self.path_target_rabbitmq_dev
                elif 'rocketmq' in _type:
                    title = self.title_target_rocketmq_dev
                    path = self.path_target_rocketmq_dev
        data = self.common_build(
            title,
            path
        )
        self.build(
            data
        )
